package com.service.Impl;

import java.util.ArrayList;
import java.util.List;

import com.service.BookService;
import org.apache.ibatis.session.SqlSession;

import com.dao.BookDAO;
import com.entity.Book;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class BookServiceImpl implements BookService {
	@Autowired
	private BookDAO bookDAO;
	public List<Book> showBySale(){

		List<Book> book=bookDAO.showBySale();
		return book;
	}
	@Override
	public List<Book> showByEditor() {

		List<Book> book=bookDAO.showByEditor();

		return book;
	}
	@Override
	public List<Book> showByTime() {

		List<Book> book=bookDAO.showByTime();

		return book;
	}
	@Override
	public List<Book> showByPrice() {

		List<Book> book=bookDAO.showByPrice();

		return book;
	}
	@Override
	public List<Book> showByFCategory(Integer parentId) {

		List<Book> book=bookDAO.showByFCategory(parentId);

		return book;
	}
	@Override
	public List<Book> showBySCategory(Integer categoryId) {

		List<Book> book=bookDAO.showBySCategory(categoryId);

		return book;
	}
	@Override
	public List<Book> showBySearch(String bookName) {

		List<Book> book=bookDAO.showBySearch(bookName);

		return book;
	}
	@Override
	public Book showOne(Integer bookId) {
		System.out.println(bookId);
		Book book=bookDAO.showOne(bookId);
		System.out.println(book);
		return book;
	}
}
